<#assign ctx = request.contextPath />
<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />
    <title>申请提现</title>
    <link href="${ctx}/assets/css/bootstrap.min.css" rel="stylesheet"/>
    <link href="${ctx}/assets/css/weixing.css" rel="stylesheet"/>
    <link href="${ctx}/assets/css/sco.message.css" rel="stylesheet"/>
  </head>
  <body>
  	<input type="hidden" id="virtual" value="${weixinManager.virtual?if_exists}">
  	<form id="submit_form" action="${ctx}/wx/v1/ConsumerManager/applyTixianPost" method="post">
  		<input type="hidden" id="wxuser" name="wxuser" value="${wxuser}" />
	  	<div class="list-group-item active">
		    <p style="text-align:left; float: left; margin-bottom: 0px;">余额：</p>             
		    <p style="text-align: right; margin-bottom: 0px;">${weixinManager.virtual?if_exists}元</p>
		</div>
	  	<div class="form-group" style="margin:10px 15px 0px 15px;">
			<div class="form-vip">
				<input id="money" name="money" class="form-control floating-label" type="number" style="border:1px solid #E5E5E5;" placeholder="提现金额">
			</div>
		</div>
		<div class="form-group" style="margin:10px 15px 20px 15px;">
			<div class="form-vip">
			<textarea id="memo" name="memo" class="form-control" rows="3" placeholder="备注" style="border:1px solid #E5E5E5;"></textarea>
			</div>
		</div> 
		<div class="denglu">
			<button id="submit_button" type="button" class="btn btn-default btn-block" style="color:#ffffff">提交</button>
		</div>
	</form>
	
    <script src="${ctx}/assets/js/jquery-1.11.0.min.js"></script>
    <script src="${ctx}/assets/js/bootstrap.min.js"></script>
    <script src="${ctx}/assets/js/sco.message.js"></script>
    <script type="text/javascript">
		$(document).ready(function(){
			$("#submit_button").click(function(){
				
				var money=$("#money").val();
				var reg=/^(\d+)(.[0-9]{0,2})?$/;
				if(!reg.test(money)){
			       $.scojs_message('无效的金额！', $.scojs_message.TYPE_ERROR);
			       return;
			    }
			    
			    if(parseFloat(money)>parseFloat($("#virtual").val())){
			    	$.scojs_message('余额不足！', $.scojs_message.TYPE_ERROR);
			    	return;
			    }
			    
			    $("#submit_form").submit();
			    
			});
		});
	</script>
  </body>
</html>